package cn.raths.controller;

import cn.raths.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {


    @Value("${server.port}")
    private Integer port;

    @GetMapping("/getById/{id}")
    public User getUserById(@PathVariable Long id){
        System.out.println("端口号" + port);
        User user = new User();
        user.setId(id);
        user.setName("张三");
        user.setAddress("成都,端口号" + port);

        return user;
    }
}
